﻿<%@ Page Title="" Language="C#" MasterPageFile="~/User/User.Master" AutoEventWireup="true" CodeBehind="JCCDMX_JC_WL.aspx.cs" Inherits="CoolERP_Web.User.JCCDMX_JC_WL" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script src="../Scripts/lhgdialog/lhgcore.min.js" type="text/javascript"></script>
<script type="text/javascript">
    var DG = frameElement.lhgDG;
    //打印预览
    function MyPreview() {
        CreatePrintPage();
        LODOP.PREVIEW();
    }

    //订单的主体和尾部
    function CreatePrintPage() {
        AddTitle();
        //设置主体内容样式
        var strBodyStyle = "<style>table,tr,td,th { border: 1 solid #000000;border-collapse:collapse }</style>";
        var strFormHtml = strBodyStyle + "<table>" + $("#GridView1").html() + "</table>";
        //主体
        LODOP.ADD_PRINT_HTM(220, 20, 716, 512, strFormHtml);
//        LODOP.ADD_PRINT_TABLE(220, 20, 716, 512, "<table align=center border=1 style='text-align:center border-color:Black'>" + $("#GridView1").html() + "</table>");
        LODOP.ADD_PRINT_LINE(215, 14, 215, 725, 0, 1); //第一条线
        LODOP.ADD_PRINT_LINE(1025, 14, 1025, 725, 0, 1); //第二条线
        LODOP.ADD_PRINT_TEXT(1035, 580, 120, 10, "页号：第#页/共&页");
        LODOP.ADD_PRINT_TEXT(1035, 40, 200, 10, "打印时间：" + (new Date()).toLocaleDateString() + " " + (new Date()).toLocaleTimeString());
        //设置纸张大小
        LODOP.SET_PRINT_PAGESIZE(3, 0, 0, "A4");
    };

    //订单的头部
    function AddTitle() {
        LODOP.PRINT_INIT("打印产品仓库进仓单预览");
        LODOP.ADD_PRINT_TEXT(15, 102, 455, 30, "中山市华盛家具制造有限公司  物料仓库进仓单");
        //设置样式，而且只对下面的起作用
        LODOP.SET_PRINT_STYLEA(1, "FontSize", 13);
        LODOP.SET_PRINT_STYLEA(1, "Bold", 1);
        //离顶部距离，离左边距离，长度，高度，内容
        LODOP.ADD_PRINT_TEXT(70, 15, 200, 20, "验收部门：" + $("#ContentPlaceHolder1_liBMMC").text());
        LODOP.SET_PRINT_STYLEA(2, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(2, "Bold", 1);
        //128A：编码的方式，还有128B、EAN13、EAN128A、Code39等 
        LODOP.ADD_PRINT_BARCODE(55, 450, 100, 50, "128A", $("#ContentPlaceHolder1_liBH").text());
        LODOP.SET_PRINT_STYLEA(3, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(3, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(95, 15, 300, 20, "验收人：" + $("#ContentPlaceHolder1_liRYMC").text());
        LODOP.SET_PRINT_STYLEA(4, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(4, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(120, 15, 500, 20, "进仓时间：" + $("#ContentPlaceHolder1_liRQ").text());
        LODOP.SET_PRINT_STYLEA(5, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(5, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(145, 15, 500, 20, "进仓原因：" + $("#ContentPlaceHolder1_liReason").text());
        LODOP.SET_PRINT_STYLEA(6, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(6, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(120, 415, 300, 20, "供应商：" + $("#ContentPlaceHolder1_liGYS").text());
        LODOP.SET_PRINT_STYLEA(7, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(7, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(145, 415, 500, 20, "关联供应商单据：" + $("#ContentPlaceHolder1_liGLDJ").text());
        LODOP.SET_PRINT_STYLEA(8, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(8, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(170, 15, 500, 20, "结算方式：" + $("#ContentPlaceHolder1_liJSFS").text());
        LODOP.SET_PRINT_STYLEA(9, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(9, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(170, 415, 300, 20, "送货人：" + $("#ContentPlaceHolder1_liSHR").text());
        LODOP.SET_PRINT_STYLEA(10, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(10, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(195, 15, 500, 20, "备注：" + $("#ContentPlaceHolder1_liBZ").text());
    };	
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td class=tbHead_L></td>
        <td class=tbHead_M><div><b>进仓单编号：<asp:Label ID="liBH" runat=server/></b></div></td>
        <td class=tbHead_R></td>
    </tr>
    <tr>
        <td class=tbBody_L></td>
        <td class=tbBody_M>
            <ul class=tags style="width:100%;">
                <li class=liTitle><div>详细信息</div></li>
                <li class=liRight>状态：<asp:Label ID="liZT" runat=server ForeColor=Red/></li>
            </ul>
            <table class="grvCSS" cellspacing=0 cellpadding=5 border=1 style="width:100%;border-collapse:collapse;">
                <tr>
                    <td style="text-align:right; width:13%">供应商:</td><td style="text-align:left; width:20%"><asp:Label ID="liGYS" runat=server/></td>
                    <td style="text-align:right; width:14%">关联供应商单据:</td><td style="text-align:left; width:20%"><asp:Label ID="liGLDJ" runat=server/></td>
                    <td style="text-align:right; width:13%">进仓原因：</td><td style="text-align:left; width:20%"><asp:Label ID="liReason" runat=server/></td>
                </tr>
                <tr>
                    <td style="text-align:right">结算方式：</td><td style="text-align:left"><asp:Label ID="liJSFS" runat=server/></td>
                    <td style="text-align:right">送货人：</td><td style="text-align:left"><asp:Label ID="liSHR" runat=server/></td>
                    <td style="text-align:right">进仓时间：</td><td style="text-align:left"><asp:Label ID="liRQ" runat=server/></td>
                </tr>
                <tr>
                    <td style="text-align:right">验收部门：</td><td style="text-align:left"><asp:Label ID="liBMMC" runat=server/></td>
                    <td style="text-align:right">验收人：</td><td style="text-align:left"><asp:Label ID="liRYMC" runat=server/></td>
                    <td style="text-align:right">备注:</td><td style="text-align:left"><asp:Label ID="liBZ" runat=server/></td>
                </tr>
            </table>
            <ul class=tags style="width:100%;">
                <li class=liTitle><div>明细列表</div></li>
                <li class=liRight>总计金额：<asp:Label ID="liMoney" runat=server ForeColor=Red/><asp:Label ID="liHB" runat=server/></li>
            </ul>
            <asp:GridView ID="GridView1" runat="server" Width=100% PageSize=1000 ClientIDMode=Static CssClass="grvCSS" AutoGenerateColumns="False" AllowPaging="True">
                <Columns>
                    <asp:TemplateField HeaderText="序号">
                        <ItemTemplate><%# Container.DataItemIndex + 1 %></ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="物料编号" DataField="BH"/>
                    <asp:BoundField HeaderText="物料名称" DataField="MC"/>
                    <asp:BoundField HeaderText="物料规格" DataField="GG"/>
                    <asp:BoundField HeaderText="颜色" DataField="YS"/>
                    <asp:BoundField HeaderText="单位" DataField="DWMC"/>
                    <asp:BoundField HeaderText="单价" DataField="DJ" DataFormatString="{0:C}"/>
                    <asp:BoundField HeaderText="数量" DataField="SL"/>
                    <asp:TemplateField HeaderText="金额">
                        <ItemTemplate><%# (Convert.ToDecimal(Eval("DJ")) * Convert.ToDecimal(Eval("SL"))).ToString("C")%></ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="仓库" DataField="CKMC"/>
                    <asp:BoundField HeaderText="仓位" DataField="CWMC"/>
                </Columns>
                <PagerSettings Visible=false />
            </asp:GridView>
            <div style="text-align:center; margin:10px;">
            <input type=button value="打印预览" onclick="MyPreview()" class=btn_s />&nbsp;&nbsp;
            <input type=image src="../Images/Common/btn_close.png" onclick="DG.cancel();" /></div>
        </td>
        <td class=tbBody_R></td>
    </tr>
    <tr>
        <td class=tbFoot_L></td>
        <td class=tbFoot_M></td>
        <td class=tbFoot_R></td>
    </tr>
</table>
</asp:Content>
